package com.zhida.chatservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author ling
 * @since 2024-07-19
 */
@Getter
@Setter
@TableName("user_message")
public class UserMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 消息id
     */
    @TableId(value = "message_id", type = IdType.AUTO)
    private Integer messageId;

    /**
     * 用户名
     */
    @TableField("username")
    private String username;

    /**
     * 来自
     */
    @TableField("come_from")
    private String comeFrom;

    /**
     * 时间
     */
    @TableField("time")
    private String time;

    /**
     * 消息内容
     */
    @TableField("msg")
    private String msg;

    public UserMessage(String username, String comeFrom, String dateTime, String msg) {
        this.username = username;
        this.comeFrom = comeFrom;
        this.time = dateTime;
        this.msg = msg;
    }
}
